package com.hs.sentinelr.handler;

import java.util.concurrent.TimeUnit;

/**
 * 默认令牌桶配置
 */
public class DefaultLimitProperties implements LimitProperties {

    private int replenishRate;

    private int burstCapacity;

    private TimeUnit timeUnit;

    public DefaultLimitProperties() {
    }

    public DefaultLimitProperties(int replenishRate, int burstCapacity, TimeUnit timeUnit) {
        this.replenishRate = replenishRate;
        this.burstCapacity = burstCapacity;
        this.timeUnit = timeUnit;
    }

    @Override
    public int replenishRate() {
        return replenishRate;
    }

    @Override
    public int burstCapacity() {
        return burstCapacity;
    }

    @Override
    public TimeUnit timeUnit() {
        return timeUnit;
    }
}
